1. Introduction

The formalization of programming language semantics, particularly those involving recursive data structures and intricate relations such as subtyping, presents substantial challenges within interactive proof assistants like Coq. These challenges are amplified when dealing with equi-recursive types, which are often conceptualized as infinite structures, thereby demanding coinductive reasoning methods.1 The inquiry motivating this report centers on the application of sophisticated coinductive techniques, specifically those characterized by “bisimulation (maybe define by chain + tower induction),” to the theoretical framework established in Gapeyev, Levin, and Pierce’s seminal paper, “Recursive subtyping revealed”.1 This suggests an interest in leveraging modern Coq libraries that furnish powerful and abstract coinductive proof principles, moving beyond the foundational coinductive definitions and manual guardedness proofs native to Coq.2

This report aims to explore how such advanced coinductive methodologies, particularly those related to tower induction and companion operators—as prominently featured in libraries like Damien Pous’s coq-coinduction 3—can be effectively employed. These contemporary approaches will be contrasted with earlier formalization strategies, such as the “folding” technique proposed by Komendantsky 1, to provide a comprehensive perspective on the available tools and techniques. The primary objective is to delineate how these advanced methods can facilitate the formal definition, verification of algorithms, and proof of key theorems presented in “Recursive subtyping revealed.” A significant emphasis will be placed on how these techniques address and manage Coq’s stringent guardedness requirements, which are crucial for ensuring the soundness of coinductive proofs. The underlying motivation for exploring these advanced techniques stems from a desire to make the formalization of complex programming language theories more manageable, robust, and less reliant on highly specialized, manual proof efforts, thereby potentially lowering the barrier for such ambitious verification projects.

2. Foundations: Recursive Subtyping, Coinduction, Simulation, and Bisimulation

A clear understanding of the foundational concepts from “Recursive subtyping revealed” 1 and the precise meanings of coinduction, simulation, and bisimulation is essential before delving into advanced formalization techniques.

2.1. Key Concepts from “Recursive Subtyping Revealed”

The work by Gapeyev, Levin, and Pierce 1 provides a comprehensive coinductive treatment of subtyping for recursive types. Several definitions and results are central to any formalization effort:

  • Equi-recursive Types as Infinite Trees: A cornerstone of the paper is the treatment of equi-recursive types (e.g., μX.T) not as distinct entities from their unfoldings, but as mere abbreviations for the infinite trees that result from unrolling the recursion indefinitely.1 For instance, μX.Nat→X is seen as Nat→(Nat→(Nat→…)). This inherently infinite nature necessitates coinductive reasoning.

  • Coinductive Subtyping on Trees (vS): Definition 4.2 in 1 defines the subtyping relation S<:T between two (potentially infinite) tree types S and T as the greatest fixed point (denoted vS) of a generating function S. The universe for this function is T×T, where T is the set of all tree types. The generating function S:P(T×T)→P(T×T) is defined as:

    S(R)={(T,Top)∣T∈T}∪{(S1​×S2​,T1​×T2​)∣(S1​,T1​)∈R∧(S2​,T2​)∈R}∪{(S1​→S2​,T1​→T2​)∣(T1​,S1​)∈R∧(S2​,T2​)∈R}.

    The choice of a greatest fixed point (vF) is characteristic of coinductive definitions, as it captures all pairs of types that can consistently satisfy the subtyping rules indefinitely, accommodating their potentially infinite structure.1 An inductive definition (least fixed point) would, by contrast, only capture finite approximations and fail to model the infinite nature of these equi-recursive types.

  • μ-Types and Subtyping (vSm): To work with finite representations, Section 9 of 1 introduces μ-types (e.g., μX.T) as a concrete syntax for regular infinite trees. A corresponding subtyping relation, vSm, is defined for these μ-types (Definition 9.4). This relation is also the greatest fixed point of a generating function Sm​, which includes rules for unfolding μ-binders:

    Sm​(R)=⋯∪{(S,μX.T)∣(S,{X↦μX.T}T)∈R}∪{(μX.S,T)∣({X↦μX.S}S,T)∈R,T=Top,T=μY.T1​}.

    The conditions T=Top and T=μY.T1​ in the last clause are to ensure invertibility of the generating function.1

  • Correspondence Theorem (Theorem 9.7): A pivotal result, Theorem 9.7 in 1, establishes the equivalence between the syntactic subtyping on μ-types and the semantic subtyping on their corresponding infinite tree representations: (S,T)∈vSm⟺treeof(S,T)∈vS. Here, treeof is the function mapping a closed μ-type to its infinite tree unfolding.1 Formalizing this theorem in Coq is a significant undertaking that would directly benefit from advanced coinductive techniques. Such a proof would likely involve constructing a relation that embodies this correspondence and proving it using coinduction, where methods like tower induction could be instrumental in managing the coinductive hypothesis across the different syntactic forms of μ-types and their tree unfoldings.

2.2. The Distinction: Simulation for Subtyping, Bisimulation for Equality

The terms “simulation” and “bisimulation” are often used in the context of coinductive reasoning, and it is crucial to distinguish their roles concerning subtyping and type equality.

  • Subtyping as Simulation: “Recursive subtyping revealed” explicitly notes that the interpretation of subtyping in terms of simulation leads to coinductively motivated fixpoint rules.1 A type S is a subtype of T (S<:T) if S can “simulate” T. For function types, this means S1​→S2​<:T1​→T2​ if T1​ can simulate S1​ (contravariance in argument) and S2​ can simulate T2​ (covariance in result). Simulation is a pre-order (reflexive and transitive) but not necessarily symmetric.

  • Type Equality as Bisimulation: In contrast, type equality corresponds to bisimulation.1 Two types S and T are considered equal if they can mutually simulate each other’s behavior indefinitely. Bisimulation is an equivalence relation (reflexive, symmetric, and transitive).6

The user’s query mentions “bisimulation” in the context of formalizing “anything” in a paper predominantly about subtyping (which is a simulation). This suggests two interpretations:

  1. Formalizing type equality for the μ-types defined in 1 using a coinductively defined bisimulation relation.
  2. Employing advanced coinductive proof techniques, which are often developed and explained in the context of bisimulation (such as up-to techniques 8), to prove properties of the subtyping (simulation) relation itself. This latter interpretation seems more aligned with the goal of formalizing “anything in this paper” and is the primary focus of this report. The report should therefore clarify that while subtyping is a simulation, the methodological toolkit often associated with “bisimulation” (i.e., advanced coinduction) is indeed applicable.

3. Advanced Coinductive Techniques in Coq: “Chain + Tower Induction” and Companions

The user’s reference to “bisimulation (maybe define by chain + tower induction)” points towards a sophisticated class of coinductive proof techniques available in Coq, designed to offer more abstract and powerful reasoning capabilities than basic CoInductive definitions and cofix proofs. These methods aim to simplify the management of coinductive hypotheses and address Coq’s guardedness conditions more semantically.

3.1. Demystifying “Chain + Tower Induction”: The coq-coinduction Library

The phrase “chain + tower induction” strongly suggests the family of coinductive techniques developed by Damien Pous and others, notably implemented in the coq-coinduction library.3

  • Tower Induction: This is a coinductive proof principle that provides a structured approach to constructing coinductive proofs. The coq-coinduction library includes a module tower.v which lays out the “abstract theory of coinduction via tower induction”.3 It facilitates the iterative construction of a relation that is ultimately shown to be a bisimulation or simulation. The “chain” aspect may refer to this iterative build-up or the sequence of implications inherent in a coinductive argument. An updated version of the library (>= 1.5) features a companion built using tower induction.9

  • The Companion Operator: A key concept introduced in Pous’s work, particularly “Coinduction All the Way Up” 4, is the companion. For a monotone function b on a complete lattice, its companion t is defined as the largest function f such that fb≤bf. When proving a coinductive property x∈νb, instead of showing x∈b(x), one can show x∈b(t(x)) (or related formulations). The companion t often encapsulates “up-to techniques,” which allow proofs to be conducted on smaller, more manageable relations. Using b∘t (or b∘Ψ(b) where Ψ(b) is the companion) as the generating function can simplify coinductive reasoning by systematically incorporating these enhancements.

The development of tower induction and companions signifies a move towards more declarative and semantically grounded coinductive reasoning in Coq. These methods abstract away some of the syntactic complexities and manual effort associated with Coq’s core logic for coinduction, allowing users to focus more on the coinductive argument itself rather than the intricate details of syntactic well-formedness of the Coq proof term.

3.2. Parameterized Coinduction (Paco Library)

While perhaps not the direct referent of “chain + tower induction,” Parameterized Coinduction, implemented in the Paco library 11, represents a closely related and highly effective advanced coinductive technique.

  • Parameterized Greatest Fixed Point Gf(r): The central idea is the parameterized greatest fixed point, typically denoted Gf(r) (or P(r) in some notations), defined as νy.f(r∪y). Here, f is the monotone generating function of the coinductive predicate, and r represents the “accumulated knowledge” or the current set of coinductive hypotheses already assumed or proven.11 This formulation allows for incremental proof development, where the coinductive hypothesis r can be extended as the proof progresses.

  • Semantic Guardedness: A major advantage of Paco is its provision of a semantic account of guardedness. Coq’s native cofix command relies on a syntactic check performed on the completed proof term to ensure that all recursive calls (uses of the coinductive hypothesis) are “guarded” by a constructor of the coinductive type.2 This check can be fragile and computationally expensive. In contrast, Paco’s pcofix tactic transforms the proof goal in such a way that the coinductive hypothesis r is used in a context that is semantically guarded by construction. This eliminates the need for a global syntactic check on the final proof term and allows for more flexible proof strategies, including better interaction with automated tactics.11

  • Compositionality and Incrementality: Parameterized coinduction naturally supports compositional reasoning by allowing proofs to be broken into smaller, interdependent pieces. It also facilitates incremental reasoning, where the full extent of the coinductive hypothesis does not need to be determined upfront but can be discovered and generalized during the proof process.11

3.3. Bisimulation Up-to Techniques

Up-to techniques are designed to simplify bisimulation (and simulation) proofs by reducing the size of the relation that needs to be explicitly constructed and verified.8 Instead of showing that a relation R is itself a bisimulation, one shows that R satisfies a weaker condition, typically involving “evolving to” some function F applied to R (e.g., R⊆B(F(R)), where B is the bisimulation-generating function). Common examples include bisimulation up to bisimilarity itself (R⊆B(∼R∼)) or up to context.

The companion operator from Pous’s work provides a unifying theoretical framework for many such up-to techniques.10 While these techniques are powerful for strong bisimulations, their application to weak bisimulations (which abstract over silent τ-actions, common in concurrency theory) introduces significant challenges. The issue is that τ-transitions can be “cancelled” or absorbed by the weak bisimilarity relation, potentially leading to unsoundness if up-to techniques are applied naively.8 While “Recursive subtyping revealed” does not explicitly deal with silent actions in the types it considers, the general theory of up-to techniques and their careful application is relevant when considering advanced coinductive proof methodologies.

These advanced libraries and the theoretical frameworks they embody make coinduction more accessible and practical for substantial formalizations. They provide the necessary tools to manage the inherent complexities of coinductive proofs, such as the correct handling of coinductive hypotheses and ensuring productivity (guardedness) without imposing overly restrictive syntactic constraints. The “chain” aspect mentioned by the user could be interpreted as the step-by-step application of coinductive rules within the tower induction framework, or the iterative refinement of the relation being proved coinductive, a characteristic also shared by parameterized coinduction.

4. Applying Advanced Bisimulation/Coinduction to “Recursive Subtyping Revealed”

The advanced coinductive techniques discussed can be powerfully applied to formalize various aspects of “Recursive subtyping revealed”.1 The choice of what to formalize with “bisimulation” techniques largely hinges on interpreting “bisimulation” in a broader sense as “advanced coinduction.” The most fruitful applications are likely in proving properties of the subtyping relation (which is a simulation), verifying the correctness of the presented algorithms, and formalizing type equality (which is a true bisimulation).

4.1. Formalizing Type Equality (A True Bisimulation)

Although “Recursive subtyping revealed” primarily focuses on subtyping, its framework of μ-types readily supports a definition of type equality. This equality relation would be a bisimulation.

A bisimulation relation S≈T for μ-types from 1 could be coinductively defined with rules such as:

  • Top≈Top
  • S1​×S2​≈T1​×T2​ if S1​≈T1​ and S2​≈T2​
  • S1​→S2​≈T1​→T2​ if S1​≈T1​ and S2​≈T2​ (Note: for equality, function arguments are typically covariant, unlike the contravariance seen in subtyping rules).
  • μX.S≈T if {X↦μX.S}S≈T (and symmetrically, S≈μX.T if S≈{X↦μX.T}T).
  • More directly, μX.S≈μY.T if {X↦μX.S}S≈{Y↦μY.T}T, assuming α-equivalence or a canonical representation of bound variables.

To formalize this in Coq:

  1. Define S≈T as a CoInductive predicate.
  2. Utilize tactics from advanced coinduction libraries, such as pcofix from Paco 11 or those based on tower induction/companions from coq-coinduction 3, to prove fundamental properties of . For example, proving that is an equivalence relation (reflexivity, symmetry, transitivity) would involve coinductive arguments.
  3. Proving transitivity (S≈U∧U≈T⟹S≈T) coinductively requires careful management of the coinductive hypothesis, which now involves two existing bisimilarity assumptions. Advanced techniques are designed to simplify this management and ensure guardedness is maintained.

4.2. Formalizing Proofs About the Subtyping Relation (vS/vSm)

This avenue directly addresses formalizing “anything in this paper” 1, where the subtyping relation itself (<:, corresponding to vS for trees or vSm for μ-types) is a simulation.

  • Proving Properties of <::

    • Reflexivity and Transitivity: Theorem 4.7 in 1 proves that vS is transitive using a specific coinductive argument. Formalizing this proof in Coq could leverage tower induction or parameterized coinduction. While Komendantsky’s “folding” paper 1 strategically places transitivity within an inductive component to manage Coq’s guardedness, advanced coinductive tools might permit a more direct coinductive proof of transitivity for vS (or vSm). The rel.v module in coq-coinduction, providing tools for the complete lattice of binary relations, could be particularly useful for reasoning abstractly about properties like transitivity.3
    • Formalizing Theorem 9.7 (Correspondence between vSm and vS): This is a prime candidate for advanced coinduction. The proof in 1 (pp.26-27) involves demonstrating the S-consistency of treeof(vSm) and the Sm​-consistency of {(S′,T′)∣treeof(S′,T′)∈vS}. In a Coq formalization, one might define a predicate, say Correspondence R S T, where R is the coinductive hypothesis asserting that sub-pairs already satisfy the correspondence. The pcofix tactic or tower induction principles would then be employed to discharge the coinductive step, systematically handling the various cases (Top, product types, arrow types, and μ-unfoldings). The complexity of reasoning across different type structures (μ-types and their tree unfoldings) and managing recursive unfoldings (e.g., in treeof(μX.T)) makes such advanced tools invaluable.
  • Soundness and Completeness of Subtyping Algorithms:

    • “Recursive subtyping revealed” presents several algorithms, including the generic gfp algorithm for checking membership in a greatest fixed point (Definition 6.5) and the concrete subtype algorithm for μ-types (Figure 5, p.30).1
    • Theorem 6.9 in 1 establishes the partial correctness of gfp: if gfpF​(X)=true, then X⊆vF. Formalizing this theorem in Coq involves induction on the computational steps of gfp and a coinductive argument for the X⊆vF part. Parameterized coinduction could be beneficial for the X⊆vF segment by allowing the accumulation of assumptions derived from the algorithm’s execution.
    • The termination proof for the subtype algorithm (Proposition 10.11 in 1) relies on the finiteness of the set of “top-down subexpressions.” While this itself is an inductive proof, the properties of the supportSm​​ function, which the algorithm uses to explore the state space, are intimately tied to the coinductive definition of vSm.

4.3. Addressing Guardedness in Coq

A central challenge in Coq for coinductive proofs is satisfying the guardedness condition. Coq’s default mechanism for coinduction requires that any recursive call within a cofix expression (i.e., any use of the coinductive hypothesis) must be syntactically “guarded” by at least one constructor of the coinductive type being defined.2 This can be overly restrictive and cumbersome for complex proofs.

  • Semantic Guardedness with Paco: The Paco library, with its pcofix tactic, offers a semantic approach to guardedness.11 Instead of a post-hoc syntactic check on the entire proof term, pcofix transforms the proof obligation such that the coinductive hypothesis is inherently used in a guarded manner by the very structure of the parameterized greatest fixed point. This allows for more flexible proof constructions, often leading to simpler and more intuitive proof scripts, and interacts more reliably with Coq’s automation tactics.

  • Structured Proofs with coq-coinduction: The tower induction and companion-based techniques in the coq-coinduction library also provide more structured ways to construct coinductive proofs.3 These frameworks are designed such that proofs built within them naturally satisfy guardedness conditions, often by making the productivity argument more explicit or by abstracting it into the properties of the companion operator.

When formalizing relations like vSm or proving theorems about them, direct cofix proofs can become unwieldy due to nested μ-unfoldings and extensive case analyses. Advanced techniques can render these proofs more manageable by abstracting guardedness concerns, allowing the formalizer to concentrate on the core logic of the coinductive argument. The intricate nature of the coinductive arguments presented in “Recursive subtyping revealed,” for instance in the proofs of Theorem 4.7 (transitivity of vS) or Theorem 9.7 (correspondence of vSm and vS), directly motivates the adoption of these advanced Coq coinduction tools. Attempting such formalizations with simpler cofix proofs might lead to prohibitively complex proof terms that are difficult to construct and verify for guardedness.

Formalizing the subtyping algorithms (like gfp or the concrete subtype algorithm from 1) and their correctness properties (Theorems 6.9, 10.11) using these advanced techniques would provide exceptionally strong soundness guarantees for any implementations derived from the theory in “Recursive subtyping revealed.”

5. Comparison with the “Folding” Technique (from “Subtyping by Folding…“)

Komendantsky’s paper “Subtyping by Folding an Inductive Relation into a Coinductive One” 1 presents an alternative strategy for defining and reasoning about relations that involve both inductive and coinductive aspects, particularly in the context of Coq’s restrictions.

The “folding” technique defines a subtyping-like relation (termed “weak similarity”) by first establishing an inductive relation, tylei (denoted E≤R​F), which encapsulates finite reasoning steps, including crucial properties like reflexivity and transitivity.1 This inductive core is then “folded” into a coinductive wrapper, tyle (denoted E≤F). The introduction rule for E≤F is ≤intro​nRrtEFfl:E≤F. Here, r and t are proofs that the abstract relation R (used within the definition of E≤R​F) is indeed reflexive and transitive, respectively. The argument l is a proof of E≤R​F, signifying finite accessibility, and f is an inclusion of R into ≤.1

The primary motivation for this structure is to manage Coq’s guardedness condition effectively. Properties like transitivity, if defined directly on a coinductive relation in a naive way, can easily lead to non-guarded recursive calls. By placing transitivity within the inductive relation E≤R​F, its proof relies on Coq’s well-understood inductive principles. The coinductive step then inherits this property via the parameters r and t.1

Comparing this “folding” technique with the advanced coinductive methods (tower induction, companions, parameterized coinduction) reveals several distinctions:

Feature”Folding” TechniqueAdvanced Coinduction (Tower Ind./Companion/Paco)
Primary GoalDefine “weak similarity” (akin to recursive subtyping) via mixed fixed pointsGeneral coinductive proofs, including bisimulations, simulations, etc.
StructureMixed: Inductive core (E≤R​F) folded into coinductive wrapper (E≤F)Primarily direct coinductive definitions and proofs using specialized principles/tactics
Handling GuardednessRelies on the inductive part for potentially problematic properties (e.g., transitivity)Semantic guardedness (Paco) or structured proof principles (tower/companion) that ensure guardedness by construction
Transitivity ProofExplicit rule in the inductive part (E≤R​F)Potentially a direct coinductive proof on the main coinductively defined relation
Coinductive HypothesisManaged via parameters (R, f, l) to the ≤intro​ rule of E≤FManaged by library tactics/principles (e.g., pcofix, companion logic)
GeneralitySpecific pattern for certain kinds of mixed inductive-coinductive definitionsGeneral-purpose frameworks for a wide range of coinductive proofs
Coq LibrariesTypically custom definitions based on the described patternRelies on established libraries like coq-coinduction, Paco

The “folding” technique is a clever approach that leverages Coq’s robust support for induction to simplify proofs of properties that are difficult to handle purely coinductively due to guardedness. However, this may result in a definition that is structurally more complex or less direct than a purely coinductive approach, especially if powerful enough general-purpose coinductive tools are available. For instance, with advanced tools like Paco or coq-coinduction, one might attempt a direct coinductive proof of transitivity for a relation like vS or vSm, without needing to separate it into an auxiliary inductive definition, potentially leading to a more uniform coinductive specification.

The choice between the “folding” pattern and more direct advanced coinduction methods depends on the specific nature of the property being formalized and the available toolset. For properties that naturally exhibit a mixed structure (e.g., finite chains of reasoning leading to an infinitely proceeding behavior), the folding approach might offer an intuitive formalization path. However, for purely coinductive properties or when aiming for maximum generality and abstraction in coinductive reasoning, the advanced libraries are likely to be more powerful and convenient. Komendantsky’s work explicitly states its focus is on a “weaker notion of similarity that corresponds to recursive subtyping,” not bisimilarity 1, whereas the user’s query and the advanced tools discussed are well-suited for general coinductive predicates, including true bisimulations.

6. Recommendations and Path Forward for Coq Formalization

To formalize aspects of “Recursive subtyping revealed” 1 using the advanced coinductive techniques suggested by “bisimulation (maybe define by chain + tower induction),” a structured approach leveraging specialized Coq libraries is recommended.

  • Leverage Specialized Coq Libraries:

    • For methodologies aligned with “chain + tower induction” and the use of companion operators, the coq-coinduction library by Damien Pous 3 is the primary candidate. Its modules tower.v (for the abstract theory of tower induction) and companion.v (or its modern integration with tower induction 9), along with tactics for coinductive relations (rel.v, tactics.v), will be essential.
    • For a strong emphasis on semantic guardedness, compositional proof development, and incremental refinement of coinductive hypotheses, the Paco library 11 is highly advisable. Its pcofix tactic, in particular, can significantly streamline proofs by abstracting away syntactic guardedness concerns.
    • It is conceivable that elements from both libraries could be beneficial, as they address complementary aspects of advanced coinductive reasoning.
  • Formalization Strategy for “Recursive Subtyping Revealed” 1:

    1. Define μ-Types and treeof Function: Begin by formalizing the syntax of μ-types (Definition 9.1 of 1) in Coq. This will involve defining an inductive type for raw μ-type expressions. The treeof function (Definition 9.3 of 1), which maps closed μ-types to their infinite tree unfoldings, will require a coinductive definition or a corecursive function. The monadic substitution machinery detailed in Komendantsky’s paper 1 (Section 6) or a similar robust approach for handling capture-avoiding substitution in treeof(μX.T) will be necessary.
    2. Define vS and vSm Coinductively: Use Coq’s CoInductive keyword to define the generating functions S (for tree types) and Sm​ (for μ-types) as described in.1 The relations vS (subtyping on trees) and vSm (subtyping on μ-types) will then be coinductive predicates over these generating functions.
    3. Formalize Key Properties and Theorems:
      • Type Equality (Bisimulation): Define type equality for μ-types as a coinductive bisimulation relation. Employ pcofix or tactics from coq-coinduction to prove its fundamental properties, such as it being an equivalence relation (reflexivity, symmetry, transitivity).
      • Properties of vS/vSm (Simulation): Prove essential properties of the subtyping relations, such as reflexivity and transitivity (e.g., Theorem 4.7 of 1 for vS). This is a key area where advanced coinduction techniques will be crucial for managing the proof obligations and guardedness.
      • Theorem 9.7 (Correspondence vSm↔vS): This will be a central and challenging coinductive proof. Define the correspondence relation and use pcofix or tower induction methods. The proof structure in Coq will likely mirror the paper’s argument, which involves showing mutual consistency, but with the coinductive machinery of the chosen library managing the hypotheses and guardedness across the different cases (Top, product, arrow, and μ-unfoldings).
      • Algorithm Correctness (e.g., Theorem 6.9 for gfp): The proof that gfp(X)=true⟹X⊆vF involves an outer inductive argument on the execution of gfp and an inner coinductive argument for X⊆vF. The coinductive part can significantly benefit from advanced techniques like parameterized coinduction, which allows for the accumulation of assumptions derived from the algorithm’s state.
  • Addressing Guardedness Systematically: Consistently rely on the semantic guardedness provided by Paco or the structured proof methodologies of coq-coinduction. This will help avoid the often frustrating and time-consuming process of debugging syntactic guardedness violations in large, complex proof terms.

  • Start with Simpler Coinductive Proofs: Before tackling the most complex theorems like Theorem 9.7, it is advisable to gain familiarity with the chosen library’s tactics and workflow by formalizing simpler coinductive properties. Examples could include properties of infinite streams 13 or simpler relations on the defined μ-types. The informal coinductive proofs presented by Kozen 16 could also serve as excellent initial exercises for formalization.

A successful formalization of “Recursive subtyping revealed” using these advanced Coq techniques would serve a dual purpose. Firstly, it would validate the paper’s theoretical results with the high degree of assurance afforded by formal verification. Secondly, it would stand as a significant case study, demonstrating the power, practicality, and expressiveness of modern coinductive proof assistants and their associated libraries for tackling complex problems in programming language theory. A potential challenge is the learning curve associated with these advanced libraries; however, this can be mitigated by starting with the libraries’ own documentation and examples 3 and progressively applying the techniques to simpler aspects of the target formalization before addressing the most intricate theorems.

7. Conclusion

The application of advanced coinductive techniques, such as those embodied by tower induction, companion operators, and parameterized coinduction, offers significant advantages for the formalization of complex programming language theories like recursive subtyping within the Coq proof assistant. These methods provide more abstract, powerful, and often more intuitive ways to construct and manage coinductive proofs compared to relying solely on Coq’s foundational CoInductive types and cofix mechanism.

A key benefit lies in their sophisticated handling of Coq’s guardedness condition. Libraries like Paco offer semantic guardedness, ensuring proof validity by construction and improving interaction with automation, while frameworks like coq-coinduction provide structured proof principles that inherently manage productivity. This allows formalizers to focus more on the logical structure of their coinductive arguments rather than the syntactic intricacies of proof terms.

While “Recursive subtyping revealed” 1 primarily defines subtyping as a simulation, the proof methodologies often developed in the context of bisimulation are highly applicable. These advanced coinductive tools can be used to rigorously prove properties of these simulations (e.g., transitivity, correspondence with μ-type subtyping) and to verify the correctness of associated algorithms. Furthermore, they facilitate the formalization of true bisimulation relations, such as type equality for the recursive types under consideration.

Compared to earlier bespoke techniques like the “folding” method 1—which cleverly uses inductive components to manage guardedness for specific properties—these general-purpose advanced coinductive frameworks offer greater flexibility and directness for a wider range of coinductive problems. They represent an evolution in coinductive theorem proving within Coq, moving towards higher-level reasoning principles and increased automation.

In conclusion, the sophisticated coinductive tools and libraries now available in the Coq ecosystem make the formal verification of intricate theories like those in “Recursive subtyping revealed” more tractable, robust, and accessible. Their adoption can lead to high-assurance formalized mathematics and verified software components, contributing significantly to the field of programming language foundations. As these libraries mature and gain wider adoption, they are poised to enable even more ambitious formalizations of systems involving infinite behaviors and complex coinductive reasoning.